home *** CD-ROM | disk | FTP | other *** search
/ Singles Flirt Up Your Life! (German) / Singles Flirt Up Your Life.iso / data1.cab / Statemachine / questErotic4.lua < prev    next >
Text File  |  2004-01-29  |  3KB  |  85 lines

  1. beginStateMachine()
  2.  
  3.     -- called when questor builds up all known questScripts
  4.     onEnter(function(msg)
  5.         print("questErotic4 entered");
  6.         setState("initial");
  7.     end )
  8.     
  9.     -- on game over: relationship conditions get reset to 0 and all quests are reset to initial
  10.     onMsg("questreset", function(msg)
  11.         setState("initial");
  12.     end ) 
  13. ---------------------------------------------------------------------------------------------------------------------------------------    
  14.     
  15.     state("initial") 
  16.         onMsg("checkCondition", function(msg)
  17.             local mike = getParent().getParent().getCharacter(MIKE);
  18.             local elaine = getParent().getParent().getCharacter(ELAINE);
  19.  
  20.             if ( -- condition here
  21.         ----------------
  22.                 min(    mike.getRelationshipCondition(ELAINE, REL_EROTIC),
  23.                     elaine.getRelationshipCondition(MIKE, REL_EROTIC)) >= 4)
  24.         ----------------
  25.             then
  26.                 -- go to waitBed
  27. print("questErotic4 - go to waitBed");
  28.                 setState("waitBed");
  29.             end
  30.         end )
  31.         
  32.  
  33.     state("waitBed")
  34.         -- wait for elaine going to bed
  35.  
  36.         onMsg("queueInteraction", function(msg)
  37. --print("questErotic4 - queueInteraction: " .. msg.data);
  38.             local mike = getParent().getParent().getCharacter(MIKE);
  39.             local elaine = getParent().getParent().getCharacter(ELAINE);
  40.             
  41.             if msg.data == "sleep" and getStateObjectFromID(msg.sender) == elaine then
  42.                 -- go to talk position, mike kisses elaine
  43.                 
  44.                 --elaine.cancelCurrentActivity(); -- cancel aktuelle activity, damit die eingepushedten drankommen
  45.                 
  46.                 elaine.queueCommand("pm_talkCutscene", "talkCutscene", mike, "questErotic4");
  47.                 elaine.queueCommand("pm_kissSexy", "kiss", mike, "Sexy", false); -- muss elaine sein sonst geht sie shclafen wΣhrend mike noch versucht sie zu kuessen
  48.                 
  49.  
  50.                 setState("talktome");
  51.             end
  52.         end )
  53.         
  54.     state("talktome")
  55.         -- as soon as arrived - start dialog (interaction.talkCutscene sends talking)
  56.         onMsg("talking", function(msg)
  57.             if (msg.data == "questErotic4") then
  58.                 popupConversation("dialogErotic4");
  59.                 setState("donetalktome");
  60.             end
  61.         end )
  62.         
  63.     state("donetalktome");
  64.         -- last dialog box clicked away
  65.         onMsg("yes", function(msg)
  66.             -- cancel
  67.             local mike = getParent().getParent().getCharacter(MIKE);
  68.             local elaine = getParent().getParent().getCharacter(ELAINE);
  69.  
  70.             mike.cancelCurrentActivity();
  71.             elaine.cancelCurrentActivity();
  72.             setState("done");
  73.         end )
  74.  
  75. ---------------------------------------------------------------------------------------------------------------------------------------    
  76.  
  77.         
  78.     state("done")
  79.     
  80.     -- sackgasse hier
  81.         
  82.         
  83.         
  84. endStateMachine()
  85.